﻿<?php 
include_once("../function.php");
//print_r($_GET);//Array ( [price] => 3250 [pid] => 159 [type] => 1 [uid] => 5 [oid] => 142 )  Array ( [oid] => 175 [user_id] => 5 ) 
extract($_GET);//
//$total=trim($total);
$sql="select * from ts_cart where user_id='$uid'";
$res=mysqli_query($link,$sql);
if(is_object($res))
{
	if(mysqli_num_rows($res)>0)
	{
		$arr=array();
		while(($list=mysqli_fetch_assoc($res))!=false)
		{
			$arr[]=$list;
		}
	}
}
//print_r($arr);//Array ( [0] => Array ( [cart_id] => 74 [color] => #8000ff [size] => XXL [num] => 10 [user_id] => 3 [pid] => 159 )
$sql="select * from ts_product";
$res=mysqli_query($link,$sql);
if(is_object($res))
{
	if(mysqli_num_rows($res)>0)
	{
		$pro=array();
		while(($list=mysqli_fetch_assoc($res))!=false)
		{
			$pro[]=$list;
		}
		//print_r($pro);
	}
}
?>
<!doctype html>
<html>
 <head>
  <title>我的订单</title>
  <meta charset="utf-8"/>
    <style>
  *{margin:0px;padding:0px;}
#big{
	 width:100%;
	 height:780px;
	 border:1px solid red;
	 margin:20px auto;
	}
ul{
	 list-style-type:none;float:left;
	}
li{
	float:left;
	margin-left:15px;
	font-size:0.5em;
	color:#a5a5a5;
	
	}
span{
	float:right;
	}
.p0{
	margin-left:20px;
	}
.xs{
	margin-left:20px;
	height:50px;
	width:auto;
	border:0px solid red;
	}
.xc1{
	font-size:2em;
	margin-right:50px;
	}
#xw{
	width:100%;
	height:40px;
	border:1px solid;
	background:#1F81B0;
	line-height:40px;
	font-size:2.5em;
	
	}
	ul a:-webkit-any-link {text-decoration:none;
    color:white;
    cursor: pointer;}
ul li{margin-left:35px;
    color:white;
	
}
 	
#fl{
	margin-left:50px;
	font-size:1.3em;
	}
#s{float:left;margin-left:30px;font-size:20px;width:200px;height:20px;}
#middle{width:100%;height:auto;border:0px solid red;}
a{text-decoration:none;color:black;}
#tb{margin:50px auto;width:600px;height:500px;border:0px solid red;ma}
.sp{display:inline-block;background:url('../img/reg_icons.png') no-repeat 0px 0px scroll;width:33px;border:0px solid red;height:33px;background-Position:-64px -47px;float:left;}
td{font-size:1.2em;font-weight:bold;}
	</style>
 </head>

 <body>
<?php include_once("./login_top.php");?>
<div id="s">
	<span class="sp1"><font color="#b6b6b6">当前所在></font>我的订单</span>
</div>
<div id="middle">
 <div id="tb">
 <form action="do_order_ljgm.php" method="get" id="form" onsubmit="return check();">
	<table border=0 cellspacing=0 width="600px" height="400px" align="center">
		<tr>
			<td><span class="sp"></span><font color="#ff8000" size=5 style="margin-left:15px;">恭喜您,成功提交订单</font></td>
		</tr>
		<?php 
			$sql="select * from ts_order where order_id='$oid'";
			$res=mysqli_query($link,$sql);
			if(is_object($res))
			{
				if(mysqli_num_rows($res)>0)
				{
					$order=mysqli_fetch_assoc($res);
					$ordernum=$order['order_sn'];
					$ordertime=$order['order_time'];
					$subtotal=$order['subtotal'];

				}
			}
			
		?>
		<tr>
			<td><font style="margin-left:50px;">您的订单号是:<?=$ordernum?>
		
			</font>
			</td>
		</tr>
		<tr>
			<td><font style="margin-left:50px;">下单时间:<?=date("Y-m-d H:i:s","$ordertime");?></font></td>
		</tr>
		<tr>
			<td><font style="margin-left:100px;">订单总额:&yen;<?php if($type==1){echo $price;}elseif($type==2){echo $total;}else{echo $subtotal;}?></font></td>
		</tr>
		<tr>
			<td>
			<?php if($type==1){?>
				<input type="hidden" name="oid" value="<?=$oid?>">
				<input type="hidden" name="uid" value="<?=$uid?>">
				<input type="hidden" name="type" value="1">
				<input type="hidden" name="pid" value="<?=$pid?>">
			<?php }elseif($type==2){?>
				<input type="hidden" name="oid" value="<?=$oid?>">
			    <input type="hidden" name="uid" value="<?=$uid?>">
				<input type="hidden" name="type" value="2">
				<input type="hidden" name="pid" value="<?=$pid?>">
			<?php }?>
				<input type="submit" name="sub1" value="立即支付" style="background-color:#ff8000; width:150px; height:45px ;color:white;font-size:28px;margin-left:10px;" />
				<a href="./index.php"><input type="button" name="sub2" value="返回首页" style="background-color:#3399ff; width:150px; height:45px ;color:white;font-size:28px;margin-right:20px;margin-left:20px;" /></a>
			</td>
		</tr>
	</table>
	</form>
 </div>	
</div>	
<div><hr></div>
</div>	
	<div style="clear:both;width:100%;height:150px;border:0px solid yellow;">
	<?php $sql="select * from ts_news_cate where level=1";
		  $res=mysqli_query($link,$sql);
		  if(is_object($res))
		  {
			  if(mysqli_num_rows($res)>0)
			  {
				$arr=array();
				while(($one=mysqli_fetch_assoc($res))!=false)
				  {
				  $arr[]=$one;
				  }
				 }?>
					
				<?php foreach($arr as $v){?>
				<div style="float:left;margin-left:250px;border:0px solid red;font-size:16px;margin-top:7px;"><div style="border:px solid blue;font-size:19px;margin-left:-8px;"><?=$v["cname"]?></div>
					<?php $sql="select * from ts_news_cate where fid=$v[cid]";
					$res=mysqli_query($link,$sql);
					if(is_object($res))
					 {
						$arr2=array();
						while(($one1=mysqli_fetch_assoc($res))!=false)
						 {
							$arr2[]=$one1;
						 }
						foreach($arr2 as $vo)
						 {?>
							<div><a href="news.php?cid=<?=$vo['cid']?>"><?=$vo["cname"]?></a></div>
						<?php }
					}?>
						</div>
			<?php }
					
			 }
	?>
</div>
		
<hr color="#e5e5e5"/>
<div id="db">
	<div style="margin-left:800px;margin-top:10px;">
			关于我们|法律声明|工作机会|联系我们
	</div>

	<div style="margin-left:600px;margin-top:20px;color:#a8a8a8;">
		Copyright@2013 Thinksite Co.Let night reserved 经营许可证编号：苏A-12345678
	</div>
</div>
<script type="text/javascript">
	//inp=getElementsByTagName("input");
	/*function check()
	{
		form.sub1.onclick=function()
		{
			alert("支付成功,查看订单");parent.location.href="./do_order_ljgm.php?";return true;
		}	
		return false;
	}*/
</script>
 </body>
</html>
